/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-  */
/*
 * g-apk-object.h
 * Copyright (C) 2014 Weiketing <weikting@gmail.com>
 *
 * gtkapkmanager is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * gtkapkmanager is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _G_APK_OBJECT_H_
#define _G_APK_OBJECT_H_

#include <glib-object.h>
#include <gdk/gdk.h>

G_BEGIN_DECLS

#define G_APK_TYPE_OBJECT             (g_apk_object_get_type ())
#define G_APK_OBJECT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_APK_TYPE_OBJECT, GApkObject))
#define G_APK_OBJECT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), G_APK_TYPE_OBJECT, GApkObjectClass))
#define G_APK_IS_OBJECT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_APK_TYPE_OBJECT))
#define G_APK_IS_OBJECT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), G_APK_TYPE_OBJECT))
#define G_APK_OBJECT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), G_APK_TYPE_OBJECT, GApkObjectClass))

typedef struct _GApkObjectClass GApkObjectClass;
typedef struct _GApkObject GApkObject;
typedef struct _GApkObjectPrivate GApkObjectPrivate;


struct _GApkObjectClass
{
	GObjectClass parent_class;
	void (*open_result)(GApkObject,gboolean isOK,const gchar *message);
};

struct _GApkObject
{
	GObject parent_instance;

	GApkObjectPrivate *priv;
};

typedef void (*GApkObjectInstallCallback)(GApkObject *apk,gboolean isOk,const gchar *msg,gpointer user_data);

GType g_apk_object_get_type (void) G_GNUC_CONST;

GApkObject*
g_apk_object_new();

gboolean 
g_apk_object_open(GApkObject *self,const char *apk_file);

void 
g_apk_object_close(GApkObject *self);

void 
g_apk_object_print(GApkObject *self);

gboolean
g_apk_object_is_opened(GApkObject *self);

GdkPixbuf*
g_apk_object_get_icon(GApkObject *self);

const gchar*
g_apk_object_appname(GApkObject *self);

const gchar*
g_apk_object_package_name(GApkObject *self);

long
g_apk_object_version_code(GApkObject *self);

long
g_apk_object_apk_size(GApkObject *self);

const gchar*
g_apk_object_version_name(GApkObject *self);

void
g_apk_object_install(GApkObject *self,const gchar *device_serial,GApkObjectInstallCallback func ,gpointer data);

G_END_DECLS

#endif /* _G_APK_OBJECT_H_ */

